import requests


def sms_captcha(mobile, captcha):
    url = "http://v.juhe.cn/sms/send"
    params = {
        "mobile": mobile,
        "tpl_id": "144317",
        "tpl_value": "#code#=" + captcha,
        "key": "5aa6e684b04f0bece66c14d36a4b6d4d"
    }
    response = requests.get(url, params)
    result = response.json()
    if result['error_code'] == 0:
        return True
    else:
        return False
